<!doctype html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="../view/admin/css/common.css">
  <link rel="stylesheet" href="../view/admin/css/style.css">
  
  <script type="text/javascript" src="../view/admin/js/jquery.min.js"></script>
  <script type="text/javascript" src="../view/admin/js/left.js"></script>
  
  <script type="text/javascript" src="../view/admin/js/jquery.SuperSlide.js"></script>
  <script type="text/javascript">
  $(function(){
      $(".sideMenu").slide({
         titCell:"h3", 
         targetCell:"ul",
         defaultIndex:0, 
         effect:'slideDown', 
         delayTime:'500' , 
         trigger:'click', 
         triggerTime:'150', 
         defaultPlay:true, 
         returnDefault:false,
         easing:'easeInQuint',
         endFun:function(){
              scrollWW();
         }
       });
      $(window).resize(function() {
          scrollWW();
      });
  });
  function scrollWW(){
    if($(".side").height()<$(".sideMenu").height()){
       $(".scroll").show();
       var pos = $(".sideMenu ul:visible").position().top-38;
       $('.sideMenu').animate({top:-pos});
    }else{
       $(".scroll").hide();
       $('.sideMenu').animate({top:0});
       n=1;
    }
  } 

var n=1;
function menuScroll(num){
  var Scroll = $('.sideMenu');
  var ScrollP = $('.sideMenu').position();
  /*alert(n);
  alert(ScrollP.top);*/
  if(num==1){
     Scroll.animate({top:ScrollP.top-38});
     n = n+1;
  }else{
    if (ScrollP.top > -38 && ScrollP.top != 0) { ScrollP.top = -38; }
    if (ScrollP.top<0) {
      Scroll.animate({top:38+ScrollP.top});
    }else{
      n=1;
    }
    if(n>1){
      n = n-1;
    }
  }
}

  </script>

  <title>后台首页</title>
</head>
<body>
    <div class="side">
          
        <div class="sideMenu" style="margin:0 auto">
          <?php
       
       foreach ($row as $v) {
         if($v['level']==2){
              $row1 = $node->getstructure($row,$v['id']);
         ?>
          <h3><?php echo $v['title'];?></h3>
          <ul>
          <?php 
              foreach ($row1 as $v1) { 
                if($v1['name']=="logout"){?>
                  <li><a href="index.php?c=<?php echo $v['name'];?>&a=<?php echo $v1['name'];?>" target='_top'><?php echo $v1['title'];?></a></li>
                <?php }elseif($v['name']=="attendence" or $v['name']=="attendTotal"){?>
                  <li><a href="index.php?c=<?php echo $v['name'];?>&a=log&class=<?php echo $v1['name'];?>" target='main'><?php echo $v1['title'];?></a></li>
               <?php }else{?>
                  <li><a href="index.php?c=<?php echo $v['name'];?>&a=<?php echo $v1['name'];?>" target='main'><?php echo $v1['title'];?></a></li>
            <?php
               } 
             }
             ?>
          </ul>
           <?php  
           }
         }
      ?>

       </div>
    </div>
    
    <div class="bottom">
      <div id="bottom_bg">开发：赵景秀 闫碧薇</div>
    </div>
    <div class="scroll">
          <a href="javascript:;" class="per" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(1);"></a>
          <a href="javascript:;" class="next" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(2);"></a>
    </div>
</body>

</html>